import { GET_ARTICLE_LIST, GET_CHANNEL_LIST } from '../constants'
const initValue = {
  channels: [],
  articles: {},
}
export default function article(state = initValue, action) {
  switch (action.type) {
    case GET_CHANNEL_LIST:
      return {
        ...state,
        channels: action.payload,
      }
    case GET_ARTICLE_LIST:
      return {
        ...state,
        articles: action.payload,
      }
    default:
      return state
  }
}
